<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
       <script type="text/javascript">
           var strs = ["America","Greece","Britain","Canada","Egypt","apple"];
           var count = 0;

           for(var i = 0;i<strs.length;i++){
               if(strs[i].indexOf("a")!=-1||strs[i].indexOf("A")!=-1){
                   count++;
               }
           }
           alert(count);

          //var strs=["America","Greece","Britain","Canada","Egypt","apple"];
          //var count=0;
          //if(strs[0].indexOf("a")!=-1){
          //    count++;

          //}
          // if(strs[1].indexOf("a")!=-1){
          //     count++;
          //}
          // if(strs[2].indexOf("a")!=-1){
          //     count++;

          // }
          // if(strs[3].indexOf("a")!=-1){
          //     count++;

          // }
          // if(strs[4].indexOf("a")!=-1){
          //     count++;

          // }
          // if(strs[5].indexOf("a")!=-1){
          //     count++;

          // }

          // alert(count);
       </script>
    </body>
</html>